

function getAllProductDetail(){
	$.ajax({
		type : "POST",
		url : "/admin/pages/ajax/getAllProducts.php", 
		async : true,
		data: {refresh: true},
		success : function(data) {
			
			data = $.parseJSON(data);
			$('table tbody tr').remove();
			var htmlStr= "";
			$
					.each(data,
							function(key, value) {
									
						htmlStr = htmlStr + "<tr ref='row-" + value.productID + "'> "+
						"<td><input class='product_check' type='checkbox' refid='"+value.productID+"'/></td>"+
						"<td><span class='productID'>" + value.productID + "</span></td>"+
						"<td><span class='name'>" + value.name + "</span></td>"+
						"<td><span class='price'>" + value.price + "</span></td>"+
						"<td><span class='man_name'>" + value.manufacturer_name + "</span></td>"+
						
						"<td><span class='sup_name'>" + value.supplier_name + "</span></td>"+
						"<td><span class='category_name'>" + value.category_name + "</span></td>"+
						"<td><span class='image'>" + value.image + "</span></td>"+
						
						
						"<td> <a title='Edit'><img src='/admin/resources/images/icons/pencil.png' alt='Edit' /></a>"+
							 "<a href='#' title='Delete' onclick ='deleteOneAuction("+value.productID+")'><img src='/admin/resources/images/icons/cross.png' alt='Delete' /></a>" + 
						
						"</td> </tr>";
					

								});
			$('table tbody').html(htmlStr);
		
		}
	});	
}

function deleteProducts(productList) {

	var product_list = productList.join(",");
	
	$.ajax({
		type : "POST",
		url : "/admin/pages/ajax/deleteProducts.php", 
		async : true,
		data: {data: product_list},
		success : function(data) {
			
			data = $.parseJSON(data);
			$('table tbody tr').remove();
			var htmlStr= "";
			$
					.each(data,
							function(key, value) {
								if (value.error ==false){
									
						$('.message').html(
								'<div class="notification success png_bg">'+
									'<a href="#" class="close"><img src="/admin/resources/images/icons/cross_grey_small.png" title="Close this notification" alt="close" /></a>'
										+'<div> Delete Rows Successful </div>'+
								'</div>');
								}
								else {
									$('.message').html(
											'<div class="notification error png_bg">'+
												'<a href="#" class="close"><img src="/admin/resources/images/icons/cross_grey_small.png" title="Close this notification" alt="close" /></a>'
													+'<div> Can Not Delete These Rows </div>'+
											'</div>');
																		
								}
								
							/*
							 * 
							 * 									<td><input class="product_check" type="checkbox" refid='<?php echo $row["productID"]?>' /></td>
									<td><span class="productID"><?php echo $row["productID"]?> </span></td>
									<td><span class="name"><?php echo $row["name"]?> </span></td>

									<td><span class="price"> <?php echo $row["price"]?> </span> </td>
									<td ><span class="man_name"><?php echo $row["manufacturer_name"]?></span></td>
									<td><span class="sup_man"><?php echo $row["supplier_name"]?> </span></td>
									<td> <span class="category_name"><?php echo$row["category_name"]?></span> </td>
									<td> <span class="image"><?php echo $row["image"]?> </span> </td>

							 */	
									htmlStr = htmlStr + "<tr ref='row-" + value.productID + "'> "+
										"<td><input class='product_check' type='checkbox' refid='"+value.productID+"'/></td>"+
										"<td><span class='productID'>" + value.productID + "</span></td>"+
										"<td><span class='name'>" + value.name + "</span></td>"+
										"<td><span class='price'>" + value.price + "</span></td>"+
										"<td><span class='man_name'>" + value.manufacturer_name + "</span></td>"+
										
										"<td><span class='sup_name'>" + value.supplier_name + "</span></td>"+
										"<td><span class='category_name'>" + value.category_name + "</span></td>"+
										"<td><span class='image'>" + value.image + "</span></td>"+
										
										
										"<td> <a title='Edit'><img src='/admin/resources/images/icons/pencil.png' alt='Edit' /></a>"+
											 "<a href='#' title='Delete' onclick ='deleteOneAuction("+value.productID+")'><img src='/admin/resources/images/icons/cross.png' alt='Delete' /></a>" + 
										
										"</td> </tr>";
									
								}

								);
			$('table tbody').html(htmlStr);
		
	}

		,error: function(){
			alert('Deleted auctions errors');
		}});
	}

/*									 
auction.find('.name').html(
		value.name);
auction.find('.pro_name').html(
		value.pro_name);
auction.find('.status').html(
			value.status);
auction.find('.start_time').html(
		value.start_time);
auction.find('.end_time').html(
		value.end_time);
auction.find('.price ').html(
		value.price);
auction.find('.auction_price ').html(
		value.auction_price);
auction.find('.quantity').html(
		value.quantity);
auction.find('.current_user_bid').html(
			value.current_user_bid);
auction.find('.price_per_bid').html(
		value.price_per_bid);
}
else {

}

*/
function showAuctionDetails(){
	
}